The present invention pertains to the field of flash memory. More particularly, the present invention relates to a method of preventing page table corruption in RAM during flash memory programming.
Flash memory is used in a wide variety of products including many types of computing, communication, and consumer electronic devices. Flash memory is a type of nonvolatile memory. Flash memory is typically organized as a memory array. Each memory array is usually composed of thousands of individual flash memory cells. Operations such as writing, reading, and erasing can be performed on flash memory. However, only one operation can typically be performed on a flash memory array at a time. For example, during a memory array write operation, a read operation cannot be performed at the same time.
Because flash memory enables the CPU to access programs without having to load them off a disk drive, flash memory is often used for storing applications such as startup programs. Page tables are also often stored in flash memory to enable access of the page tables immediately after system bootup. Alternatively, page tables can be stored in random access memory (RAM). Page tables are typically used for address translations of virtual memory addresses or logical memory addresses. Virtual memory divides physical memory into blocks and then allocates the memory blocks to different processes. Thus, page tables are often used to translate virtual memory addresses to physical memory addresses.
Logical memory addresses are addresses used in programs. Programs use logical memory addresses to access specific locations of the main memory. Aside from translating virtual memory addresses, page tables are used to map logical memory addresses to physical memory addresses.
Page tables are data structures that are indexed by the page or segment number that contain the physical address of the physical memory block. Each page is defined as a block of the physical memory or a 4 KB area of address space. The translation process generally includes accessing flash memory or wherever the page table is stored to obtain the physical memory address. In order to make the translation process more efficient, personal computers often use a translation lookaside buffer (TLB). The TLB is a cache dedicated to address translations. The TLB makes translations more efficient by eliminating the constant need to reread the page table from memory.
Because traditional magnetic disk drives are external to the computer system, accessing page tables from a magnetic disk drive is inefficient. Therefore, page tables are generally stored in main memory. However, when a computer system utilizes a Memory Management Unit (MMU), the page tables are typically stored in flash memory. The MMU is an embedded system with fixed memory attributes and addressing constraints.
Computer processors that use a MMU typically utilize page tables to control caching. Such a system can be found in portable digital audio players. An MP3 player is an example of a portable digital audio player. MP3 is a file format often used for sharing music over the internet.